import './style.scoped.css'
import React from 'react'
interface Props {
  visible: boolean
  back: () => void
}

export default function BackToTop(props: Props) {
  return (
    <>
        <div>
            <React.UI.Button 
            shape="rounded" 
            size='small' 
            color='primary'
            className='backToTop'
            onClick={() => {
                props.back()
            }}
            style={
                props.visible ? { visibility: 'visible' } : { visibility: 'hidden' }
            }
            >↑</React.UI.Button>
        </div>
    </>
  )
}